package com.company.practice;

import sun.misc.VM;

import java.nio.ByteBuffer;

/**
 * @description: OOM: unable to create new native thread   linux上同一进程一般线程最多让你申请1024，通过/etc/security/limits.d/xx.文件修改
 * @author: ruoan
 * @date: 2021/1/5 21:22
 */
public class OOMDemo3 {

    public static void main(String[] args) {
        for (int i = 1; ; i++) {
            new Thread(() -> {
                System.out.println("活动TH"+Thread.activeCount());
                try { Thread.sleep(Integer.MAX_VALUE); } catch (InterruptedException e) { e.printStackTrace(); }
            },String.valueOf(i)).start();
        }



    }


}
